package com.itheia.common;


import com.sun.net.httpserver.Authenticator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private Integer code;
    private Object data;
    private String message;
    public static R success(Object data) {
        R r = new R();
        r.setCode(1);
        r.setData(data);
        r.setMessage("success");
        return r;
    }

    public static R success(String message) {
        R r = new R();
        r.setCode(1);
        r.setMessage(message);
        return r;
    }


    public static R error(String message) {
        R r = new R();
        r.setCode(0);
        r.setMessage(message);
        return r;
    }

}
